Log level utility macros

Use these macros to define new log levels and operate on defined log levels. More...

Macros

#define KZ_LOG_CREATE_LEVEL(value, name)
 Creates a log level. More...
 
#define KZ_LOG_GET_LEVEL_VALUE(level)
 Gets a log level value. More...
 
#define KZ_LOG_GET_LEVEL_NAME(level)
 Gets a log level name. More...
 
#define KZ_LOG_IS_LEVEL_ENABLED(level)
 Checks whether a log level is enabled. More...
 

Detailed Description

Use these macros to define new log levels and operate on defined log levels.

Macro Definition Documentation

#define KZ_LOG_CREATE_LEVEL (   value,
  name 
)

Creates a log level.

Use the value parameter to assign to the new log level a unique integer value that is used to order the log levels. This value is used in log message filtering. See Classifying and filtering log messages.

Use the name parameter to provide the log level name, which the logger uses when writing messages to the log.

Parameters
valueUnique integer value used to implement the log level ordering. See Log Level.
nameThe name of the log level.
See also
kanzi::AbstractLogger, Log Level, Log levels, Classifying and filtering log messages
#define KZ_LOG_GET_LEVEL_VALUE (   level)

Gets a log level value.

Parameters
levelThe log level.
Returns
The value used to implement log level ordering.
See also
KZ_LOG_CREATE_LEVEL, Log Level
#define KZ_LOG_GET_LEVEL_NAME (   level)

Gets a log level name.

Parameters
levelThe level macro. For example, see KZ_LOG_LEVEL_ERROR.
Returns
Short string describing the log level.
See also
KZ_LOG_CREATE_LEVEL, Log Level
#define KZ_LOG_IS_LEVEL_ENABLED (   level)

Checks whether a log level is enabled.

Parameters
levelThe log level.
Returns
If the log level is enabled, 1, otherwise 0.
See also
KZ_LOG_CREATE_LEVEL, Log Level